#include "mapView.h"
#include "camera/ortho_camera.h"

MapView::MapView(const Rectangle& viewport,SceneModel& model)
	: SceneView(viewport,model){
	float aspect = viewport.width()/viewport.height();
	Cube viewVolume(Point(-25*aspect,-25,-60),Point(25*aspect,25,80));

	Point hcenter = model.getHelicopter().getDimensions().center();
	camera = new OrthoCamera(hcenter+Point(0,0,3),hcenter,Point(0,1,0),viewVolume);
}

MapView::~MapView(){
}

void MapView::setEnv(){
	glViewport ((GLint) viewport.x1,(GLint) viewport.y1, (GLsizei) viewport.width(), (GLsizei) viewport.height());
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
